from selenium import webdriver
import time

driver = webdriver.Chrome(executable_path="drive\\chromedriver.exe")
driver.maximize_window()
def getJDGoods():
    driver.get("http://www.jd.com")
    key = driver.find_element_by_id("key")
    key.clear()
    key.send_keys("手机")
    searchBtn = driver.find_element_by_xpath('//*[@id="search"]/div/div[2]/button')
    searchBtn.click()
if __name__ == '__main__':
    getJDGoods()